﻿

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
 <title>Documentation for method: 
PHPCrawler::addLinkPriority()</title>
 <meta name="keywords" content="framework, API, manual, class reference, classreference, documentation" />
 <meta name="description" content="The class reference contains the detailed description of how to use every class, method, and property." />
 <link rel="stylesheet" type="text/css" media="screen" href="style.css">
 
 <script name="javascript">
 
 function show_hide_examples(mode)
 {
   if (document.getElementById("examples").style.display == "none")
   {
     document.getElementById("examples").style.display = "";
   }
   else
   {
     document.getElementById("examples").style.display = "none";
   }
 }
 </script>
 
</head>

<body>

<div id="outer">

<h1 id="head">
  <span>Method: 
PHPCrawler::addLinkPriority()</span>
</h1>

<h2 id="head">
 <span><a href="overview.html"><< Back to class-overview</a></span>
</h2>

<br>





<!--<?php include("google_code.php"); ?> -->

<div id="docframe">

<div id="section">

Adds a regular expression togehter with a priority-level to the list of rules that decide what links should be prefered.
</div>

<div id="section">
<b>Signature:</b>
<p id="signature">
  
public addLinkPriority($regex, $level)
</p>
</div>

<div id="section">
<b>Parameters:</b>
<p>
<table id="param_list">
  
<tr><td id="paramname" width="1%"><b>$regex</b>&nbsp;</td><td width="1%"><i><i>string</i></i>&nbsp;</td><td width="*">Regular expression definig the rule</td></tr><tr><td id="paramname" width="1%"><b>$level</b>&nbsp;</td><td width="1%"><i><i>int</i></i>&nbsp;</td><td width="*">The priority-level</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Returns:</b>
<p>
<table id="param_list">
  
<tr> <td width="1%"><i><i>bool</i></i>&nbsp;</td> <td width="*">  TRUE if a valid preg-pattern is given as argument and was succsessfully added, otherwise it returns FALSE.</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Description:</b>
<p>

  
Links/URLs that match an expression with a high priority-level will be followed before links with a lower level.<br>All links that don't match with any of the given rules will get the level 0 (lowest level) automatically.<br><br>The level can be any positive integer.<br><br><b>Example:</b><br><br>Telling the crawler to follow links that contain the string "forum" before links that contain ".gif" before all other found links.<code>$crawler-&gt;addLinkPriority("/forum/", 10);<br>$cralwer-&gt;addLinkPriority("/\.gif/", 5);</code>
  
</p>
</div>





</div>


<div id="footer">Docs created with <a href="http://phpclassview.cuab.de"  target="_parent">PhpClassView</a></div>

</div>

</body>
</html>
